package com.magic233.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * ClassName: GetTimeStamp
 * Description:
 * date: 2021/6/25 16:02
 * author: zouyuan
 */
public class GetTimeStamp {
    public Long timeToTimeStamp(String time) {
        Long timeStamp;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        Date date = null;
        try {
            date = simpleDateFormat.parse(time);
            timeStamp = date.getTime();
            return timeStamp;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
